package com.alisls.demo.springcloud.service.user.dto.resource;

import com.alisls.demo.springcloud.common.model.dto.BaseDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 资源DTO
 *
 * @author Ke Wang
 * @date 2020/11/5
 */
@Getter
@Setter
@ToString
public class ResourceDTO extends BaseDTO {

    /**
     * 主键标识
     */
    private Long id;

    /**
     * 资源编码
     */
    @ApiModelProperty(value = "资源编码", required = true, example = "10011")
    @NotBlank(message = "资源编码不能为空")
    @Size(min = 4, max = 5, message = "资源编码的长度在4~5个字符之间")
    private String code;

    /**
     * 父级资源编码
     */
    @ApiModelProperty(value = "上级资源编码", required = true, example = "1001")
    @NotBlank(message = "上级资源编码不能为空")
    @Size(min = 4, max = 5, message = "上级资源编码的长度在4~5个字符之间")
    private String parentCode;

    /**
     * 资源名称
     */
    @ApiModelProperty(value = "资源名称", required = true, example = "用户管理")
    @NotBlank(message = "资源名称不能为空")
    @Size(min = 2, max = 50, message = "资源名称的长度在2~50个字符之间")
    private String name;

}
